class Solution {
    public int jump(int[] nums) {
        int post = nums.length-1;
        int sum = 0;
        while(post > 0) {
            for(int i = 0;i < post;i++) {
                if(i + nums[i] >= post) {
                    post = i;
                    sum++;
                    break;
                }
            }
        }
        return sum;
    }
}